<script>
	function add(){
		$(document).ready(function() {
			var formvalue = $("#additionalRequirement").val();
			var formdescription = "ADDITIONALREQUIRMENTS";
			
			$.ajax({  
				type: "POST",  
				url: "AddCodeTable",
				data: {
					formvalue:formvalue,
					formdescription:formdescription
				},
				crossDomain: false,
				async : true,
		   	 	success: function(response) {
		   	 		var jsonList = response;
					
					var addtionalOption = "<option value='" + jsonList.fieldId + "'>" + jsonList.fieldname + "</option>";
					$("#additionalrequirementsid").html($("#additionalrequirementsid").html()+addtionalOption);
					$("#closeMe").click();
            	},
		   		error: function(result){
		   			alert('Error occured while adding requirement '+result);
		    	}
			});
		} );
	}
</script>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal"
		aria-hidden="true">x</button>
	<h3 id="myModalLabel">Add Additional Requirement</h3>
</div>
<form name="tempForm">
<div class="modal-body">
	<table class="table table-bordered">
		<tr>
			<td>Additional Requirement</td>
			<td><input type="text" id="additionalRequirement"
				name="additionalRequirement" placeholder="Max 100 Characters"
				maxlength="25" autofocus="autofocus"></td>
		</tr>
	</table>
</div>
<div class="modal-footer" id="buttonDiv">
	<button class="btn btn-primary" type="button" id="saveEntry" onclick="add();">Save
		& Close</button>
	<button class="btn" data-dismiss="modal" aria-hidden="true"
		id="closeMe">Close</button>
</div>
</form>